package cn.kust.apiuser.service.impl;

import cn.kust.apiuser.remote.ServiceSocialClient;
import cn.kust.apiuser.service.ISocialService;
import cn.kust.microtourismcommon.pojo.dto.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author WY
 * @data 2022/7/25 16:43
 **/
@Service
public class ISocialServiceImpl implements ISocialService {

    @Autowired
    private ServiceSocialClient serviceSocialClient;

    @Override
    public ResponseResult deleteFollowById(Long userId, Long friendId) {
       String userid = Long.toString(userId);
       String friendid = Long.toString(friendId);
       return  serviceSocialClient.deleteFriend(userid,friendid);
    }

    @Override
    public ResponseResult addFollow(Long userId, Long focusUserId) {
        String userid = Long.toString(userId);
        String friendid = Long.toString(focusUserId);
        return serviceSocialClient.addFriend(userid,friendid);
    }

    @Override
    public ResponseResult findFollowById(Long userId) {

        String userid = Long.toString(userId);
        ResponseResult followList = serviceSocialClient.getFollowList(userid);
        return followList;
    }

    @Override
    public ResponseResult findFansById(Long userId) {
        String userid = Long.toString(userId);
        return serviceSocialClient.getFansList(userid);
    }
}
